import { menus } from './menus.js'
import {
  VAS_PRODUCT_INSURANCE, VAS_PRODUCT_ITINERARY, VAS_PRODUCT_VIP,
  VAS_PRODUCT_CHOICE_SEAT, VAS_PRODUCT_RENT_CAR, VAS_PRODUCT_EXTRA_LUGGAGE,
  VAS_PRODUCT_OTHER,
} from '@/common/const.js'


export const state = {
  menus: menus,

  workMode: '',
  themeMode: 0,
  bottomTabBarShowed: true,
  initialized: false,
  isRoot: false,
  logined: false,
  username: '',
  fullname: '',
  sid: '458559',
  redmineUrl: '',
  userInfo: {
    freeBalance: 0,
    cashBalance: 0,
    frozenBalance: 0,
    creditLimit: 0
  },
  searchParams: {
    dcity: null,
    dcityName: null,
    acity: null,
    acityName: null,
    ddate: null,
    sortBy: 0,
    onlyCarrier: '',
  },
  order: {
    flights: [],
    psgs: [],
    pnrNo: '',
    pnrDetail: '',
    policyId: 0
  },
  historyStep: 0,
  orderId: 0,
  orderDetail: null,
  policyDetail: null,
  pnrDetail: null,

  errAlert: false,
  errMsg: '',
  errMsgType: 'warning',

  loading: false,
  loadingText: '数据加载中',

  wxInfo: {
    code: '',
    state: '',
    openid: '',
    nickname: '',
    headimgurl: '',
    subscribe: 0
  },
  // 申请退票信息
  refundInfo: {
    ticketNo: '',
    psgName: '',
    orderId: 0
  },
  // 申请改期信息
  changeInfo: {
    ticketNo: '',
    psgName: '',
    orderId: 0
  },
  refundOrderInfo: null,
  changeOrderInfo: null,
  privileges: [],
  roles: [],
  customers: [],

  printMode: 0,

  //证件类型信息
  idTypes: [
    { idType: 1, idName: '身份证' },
    { idType: 2, idName: '护照' },
    { idType: 4, idName: '港澳通行证' },
    { idType: 8, idName: '台胞证' },
    { idType: 16, idName: '回乡证' },
    { idType: 32, idName: '台湾通行证' },
    { idType: 64, idName: '军官证' },
    { idType: 65, idName: '户口簿' },
    { idType: 66, idName: '出生证明' },
    { idType: 67, idName: '外国人永久居住身份证' },
    { idType: 68, idName: '港澳居民居住证' },
    { idType: 69, idName: '台湾居民居住证' },
    { idType: 99, idName: '其它' }
  ],
  //增值服务产品类型
  productTypes: [
    { id: VAS_PRODUCT_INSURANCE, name: '保险' },
    { id: VAS_PRODUCT_ITINERARY, name: '发票/行程单' },
    { id: VAS_PRODUCT_VIP, name: 'VIP通道' },
    { id: VAS_PRODUCT_CHOICE_SEAT, name: '选座（机上座位选择）' },
    { id: VAS_PRODUCT_RENT_CAR, name: '送机服务（租车）' },
    { id: VAS_PRODUCT_EXTRA_LUGGAGE, name: '额外行李' },
    { id: VAS_PRODUCT_OTHER, name: '其它' }
  ]
}


